﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Data;
using System.Data.SqlClient;



namespace BanmaytinhDAL
{
    public class HangInfo
    {
        private string _Mahang;
        private string _Tenhang;
        private string _Maloai;
        private string _Mahangsanxuat;
        private string _Makho;
        private string _Madonvitinh;
        private string _Thoigianbaohanh;
        private string _Thutuhienthi;
        private string _Tieude;
        private string _Motasoluoc;
        private string _Tukhoatimkiem;
        private string _Serial;
        private string _Anh;
        private string _Hienthi;


        public string Mahang{get {return _Mahang;} set{ _Mahang = value; } }
        public string Tenhang { get { return _Tenhang; } set { _Tenhang = value; } }
        public string Maloai { get { return _Maloai; } set { _Maloai = value; } }
        public string Mahangsanxuat { get { return _Mahangsanxuat; } set { _Mahangsanxuat = value; } }
        public string Makho { get { return _Makho; } set { _Makho= value; } }
        public string Madonvitinh { get { return _Madonvitinh; } set { _Madonvitinh = value; } }
        public string Thoigianbaohanh { get { return _Thoigianbaohanh; } set { _Thoigianbaohanh = value; } }
        public string Thutuhienthi{ get { return _Thutuhienthi; } set { _Thutuhienthi = value; } }
        public string Tieude { get { return _Tieude; } set { _Tieude = value; } }
        public string Motasoluoc { get { return _Motasoluoc; } set { _Motasoluoc = value; } }
        public string Tukhoatimkiem { get { return _Tukhoatimkiem; } set { _Tukhoatimkiem = value; } }
        public string Serial { get { return _Serial; } set { _Serial = value; } }
        public string Anh { get { return _Anh; } set { _Anh = value; } }
        public string Hienthi { get { return _Hienthi; } set { _Hienthi = value; } }

        public HangInfo HangIDataReader(IDataReader dr)
        {
            BanmaytinhDAL.HangInfo obj = new BanmaytinhDAL.HangInfo();
            obj.Mahang = (dr["Mahang"] is DBNull) ? string.Empty : dr["Mahang"].ToString();
            obj.Tenhang = (dr["Tenhang"] is DBNull) ? string.Empty : dr["Tenhang"].ToString();
            obj.Maloai = (dr["Maloai"] is DBNull) ? string.Empty : dr["Maloai"].ToString();
            obj.Mahangsanxuat = (dr["Mahangsanxuat"] is DBNull) ? string.Empty : dr["Mahangsanxuat"].ToString();
            obj.Makho = (dr["Makho"] is DBNull) ? string.Empty : dr["Makho"].ToString();
            obj.Madonvitinh = (dr["Madonvitinh"] is DBNull) ? string.Empty : dr["Madonvitinh"].ToString();
            obj.Thoigianbaohanh = (dr["Thoigianbaohanh"] is DBNull) ? string.Empty : dr["Thoigianbaohanh"].ToString();
            obj.Thutuhienthi = (dr["Thutuhienthi"] is DBNull) ? "0": dr["Thutuhienthi"].ToString();
            obj.Tieude = (dr["Tieude"] is DBNull) ? string.Empty : dr["Tieude"].ToString();
            obj.Motasoluoc = (dr["Motasoluoc"] is DBNull) ? string.Empty : dr["Motasoluoc"].ToString();
            obj.Tukhoatimkiem = (dr["Tukhoatimkiem"] is DBNull) ? string.Empty : dr["Tukhoatimkiem"].ToString();
            obj.Serial = (dr["Serial"] is DBNull) ? string.Empty : dr["Serial"].ToString();
            obj.Anh= (dr["Anh"] is DBNull) ? string.Empty : dr["Anh"].ToString();
            obj.Hienthi = (dr["Hienthi"] is DBNull) ? string.Empty : dr["Hienthi"].ToString();
            return obj;

        
        }
    }
}
